<script type="text/javascript">
    function submit_oplog_export(){
        var modal_selector = $("#oplog_export_modal");
        var path = modal_selector.find("#export_path");
        var time = modal_selector.find("#export_time");
        var every = modal_selector.find("#export_every");
        var period = modal_selector.find("#export_period");
        $.post("/oplog_export", {
                "name": 'oplog_export',
                "start_date": $.trim(time.val()),
                "every": $.trim(every.val()),
                "period": $.trim(period.attr("realvalue")),
                'value_setting':$.trim(path.val()),
                'description':'oplog export path',
                'schedule_job_id':'{{schedule.id}}',
                'schedule_interval_id':'{{interval.id}}',
                'sysconfig_id':'{{sysconfig_for_ump.id}}',
                'is_update':'{{is_update}}',
                },
                function(data){
                    if (data.reply.is_success){
                        SelfAlert("可在配置模块中启用或禁用","配置完成");
                        angular.element('#OplogCtrl').scope().close();
                        $('#tb_oplog_mng').trigger("reloadGrid");
                    }else{
                        error = data.reply.error;
                        SelfAlert(error);
                        angular.element('#OplogCtrl').scope().close();
                    }
                });
    }

    var periods_source = [['seconds', '秒'],['minutes', '分钟'],['hours', '小时'],['days', '天'],['months', '月']];
    $('#oplog_export_modal #export_period').rqDropDown({
        "datatype":"local",
        "source": periods_source
    });
    $('#oplog_export_modal #export_period').val(SelfTranslate('{{interval.period}}'));
set_tables();
</script>
<style>
.table .tb-item-value > div:first-child{margin-bottom:5px;color:#666}
</style>
<div class="modal-header">  
    <h3>导出配置</h3>  
</div> 
<div  class="modal-body"  id="oplog_export_modal">
<div id="dialog_oplog_export" title="export">  
    <div class="callback_error_tip error_tip"></div>            
    <div class="error_tip"></div>
    <table class="table">
        <tr class="tr-back">
            <td class="tb-item-name"><label for="export_path">导出位置:</label></td>
            <td class="tb-item-value">
         	 	<div class="error_tip"></div>
                <input id="export_path" name="export_path" size="25" type="text" value="{{sysconfig_for_ump.value_setting}}"/>
            </td>             
        </tr>
        <tr class="tr-back">
            <td class="tb-item-name"><label for="export_time">导出时间:</label></td>
            <td class="tb-item-value">
                <div class="error_tip"></div>
                <input type="text" id="export_time" maxlength="16" name="export_time" onfocus="$(this).calendar()" readonly value="{{interval.start_date}}"/>
            </td>             
        </tr>
        <tr class="tr-back">
            <td class="tb-item-name"><label for="export_period">导出周期:</label></td>
            <td class="tb-item-value">
                <div class="error_tip"></div>
                <input id="export_every" name="export_every" size="25" type="text" value="{{interval.every}}"/>
                <input id="export_period" readonly="readonly" class="rounded_dropdown" value=SelfTranslate({{interval.period}}) realvalue="{{interval.period}}" />
            </td>             
        </tr>
    </table>
</div>
</div>
<div class="modal-footer">  
    <button class="button button_gray" ng-click="ok()">[[ 'label ok'|translate ]]</button>  
    <button class="button button_gray" ng-click="cancel()">[[ 'label cancel'|translate ]]</button>  
</div>

